package chp07;

import java.util.Arrays;

public class Test12 {
    public static void main(String[] args) {
        //删除和新增
        //删除
        String[] names = {"jack","tom","mike","peter","jim"};
        System.out.println(Arrays.toString(names));
//        int index = 1;
        //移位的算法
        names[1] = names[2];
        names[2] = names[3];
        names[3] = names[4];

        names[4] = null;

        // [jack, mike, peter, jim, null]
        System.out.println(Arrays.toString(names));
    }
}
